# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-plasma
maintainer="team/kde <bribbers@disroot.org>"
pkgname=plasma-activities-stats
pkgver=6.2.3
pkgrel=0
arch="all !armhf" # armhf blocked by qt6-qtdeclarative
pkgdesc="A library for accessing the usage data collected by the activities system"
url="https://invent.kde.org/plasma/plasma-activities-stats.git"
license="LGPL-2.1-only OR LGPL-3.0-only"
depends_dev="
	boost-dev
	graphviz-dev
	kconfig-dev
	plasma-activities-dev
	qt6-qtdeclarative-dev
	qt6-qttools-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	qt6-qtbase-dev
	samurai
	"
subpackages="$pkgname-dev $pkgname-doc"

case "$pkgver" in
	*.90*) _rel=unstable;;
	*) _rel=stable;;
esac
_repo_url="https://invent.kde.org/plasma/plasma-activities-stats.git"
source="https://download.kde.org/$_rel/plasma/$pkgver/plasma-activities-stats-$pkgver.tar.xz"
options="!check" # No usable tests

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
2383f804c20fdfd658afdefc5f1d4eb0cabd2b1658cabf2cb24de2865e9ec685a7dd7048acb049a7aa91848995e34a019a43f6687c2e40b31c338a9c9de5a6aa  plasma-activities-stats-6.2.3.tar.xz
"
